var gulp = require('gulp'),
    babel = require('gulp-babel'),
    rename = require('gulp-rename');
var uglify = require('gulp-uglify');
var concat = require('gulp-concat');

gulp.task('taskES6', function(){
    gulp.src(['es6/*.es6'])
        .pipe(babel({
            presets: ['es2015']
        }))
        // .pipe(rename({suffix: '.es5'}))
        // .pipe(concat('index.js'))
        // .pipe(uglify())
        .pipe(gulp.dest('js'));
});

gulp.task('taskTem', function(){
    gulp.src(['es6/*.tem'])
        .pipe(babel({
            presets: ['es2015']
        }))
        // .pipe(rename({suffix: '.es5'}))
        // .pipe(concat('index.js'))
        .pipe(uglify())
        .pipe(gulp.dest('js'));
});

gulp.task('startWatch', function(){
    gulp.watch(['es6/*.es6','es6/*.tem'], ['taskES6','taskTem']);
});